/* ===================

AX2E (AXESCON XACML 2.0 Engine) is the Java authorization engine, which implements OASIS XACML 2.0 standard.
Copyright (C) 2007 AXESCON LLC

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA


Contact: AXESCON LLC - info{at}axescon.com

 =================== */
package axescon.xacml.api;

import axescon.xacml.model.ctx.Status;

/**
 * @author argyn
 *         Date: Jun 26, 2005
 *         Time: 12:41:44 PM
 *         Responsibilities: indicates error condition while matching XACML target and request
 */
public class TargetMatchIndeterminateException extends XacmlException {
    public TargetMatchIndeterminateException(String message, Throwable cause) {
        super(message, cause);
    }


    /**
     * construct exception using cause exception. this method will set
     * status code to cause's status code
     * @param cause source exception whcih caused this exception
     * @param errCode
     */
    public TargetMatchIndeterminateException(Throwable cause, int errCode) {
        super(cause, errCode);

        if(cause instanceof ExpressionEvalIndeterminateException){
            setStatus(((ExpressionEvalIndeterminateException)cause).getStatus());
        }
    }

    public TargetMatchIndeterminateException(String s, int errCode) {
        super(s, errCode);
    }

    public TargetMatchIndeterminateException(String s) {
        super(s);
    }

    public TargetMatchIndeterminateException() {
        super();
    }


     /**
      * construct exception using cause exception. this method will set
      * status code to cause's status code
      * @param cause
      */
    public TargetMatchIndeterminateException(Throwable cause) {
        super(cause);
        if(cause instanceof ExpressionEvalIndeterminateException){
            setStatus(((ExpressionEvalIndeterminateException)cause).getStatus());
        }
    }


    /**
     * XACML Status
     */
    private Status status;

    /**
     * gets XACML Status
     * @return XACML Status
     */
    public Status getStatus() {
        return status;
    }

    /**
     * sets XACML Status
     * @param status XACML Status
     */
    public void setStatus(Status status) {
        this.status = status;
    }
}
